快速掌握和使用Flyway

Flyway

Posted by Admin on 2019-11-06 05:30:00

什麼是Flyway?

Flyway is an open-source database migration tool. It strongly favors simplicity and convention over configuration.

Flyway是一款開源的數據庫版本管理工具,它更傾向於規約優於配置的方式。Flyway可以獨立於應用實現管理並跟踪數據庫變更,支持數據庫版本自動升級,並且有一套默認的規約,不需要復雜的配置,Migrations可以寫成SQL腳本,也可以寫在Java代碼中,不僅支持Command Line和Java API,還支持Build構建工具和Spring Boot等,同時在分佈式環境下能夠安全可靠地升級數據庫,同時也支持失敗恢復等。

Flyway主要基於6種基本命令:MigrateCleanInfoValidateBaselineand Repair,稍候會逐一分析講解。目前支持的數據庫主要有:Oracle, SQL Server, SQL Azure, DB2, DB2 z/OS, MySQL(including Amazon RDS), MariaDB, Google Cloud SQL, PostgreSQL(including Amazon RDS and Heroku), Redshift, Vertica, H2, Hsql, Derby, SQLite, SAP HANA, solidDB, Sybase ASE and Phoenix.